/*
 * ConfigIni.h
 *
 *  Created on: 2010-8-12
 *      Author: stargui
 */

#ifndef CONFIGINI_H_
#define CONFIGINI_H_

#include <map>
#include <string>

namespace Common
{

class CConfigIni
{

public:

	CConfigIni();

	virtual ~CConfigIni();

private:

	std::map<std::string, std::string> m_Settings;

private:

	void TrimString(std::string &str);

	void oSerialize(const char *FileName);

	void iSerialize(const char *FileName);

public:

	bool Serialize(const char *FileName, bool update);

	bool GetItemParameter(const char *group, const char *name, std::string &item);

	bool SetItemParameter(const char *group, const char *name, const char *item);

	bool GetItemParameter(const char *group, const char *name, unsigned long &item);

	bool SetItemParameter(const char *group, const char *name, unsigned long item);
};

}

#endif /* CONFIGINI_H_ */
